package com.red.star.wechat.data.repository;

import com.red.star.wechat.data.entity.ChatMessage;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;

/**
 * @author nofish.yan@gmail.com
 * @date 2018/2/28.
 * 聊天日志数据库访问类
 */
@Repository
public class ChatLogRepository {

    @Resource
    private MongoTemplate mongoTemplate;

    /**
     * 保存聊天记录
     *
     * @param message 聊天消息
     */
    public void saveChatLog(ChatMessage message) {
        mongoTemplate.save(message);
    }

}
